home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / xgrab.lha / xgrab / ui / interf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-24  |  5.6 KB  |  366 lines

  1. /**
  2.    GRAB Graph Layout and Browser System
  3.  
  4.    Copyright (c) 1989, Tera Computer Company
  5.  **/
  6.  
  7.   /*  C++ routines that the C routines call */
  8.  
  9. #include <InterViews/graphic.h>
  10. #include <InterViews/Graphic/lines.h>
  11. #include "att.h"
  12. #include "graph.h"
  13. #include "gmain.h"
  14. #include "dialogbox.h"
  15. #include "bview.h"
  16. #include "gframe.h"
  17. #include "helper.h"
  18.  
  19. extern "C" void IChangeGraphName (char* s) 
  20. {
  21.     g->ChangeGraphName (s);
  22. }
  23.  
  24. extern "C" void IChangeFileName (char* s) 
  25. {
  26.     g->ChangeFileName (s);
  27. }
  28.  
  29. extern "C" void IChangeStatusLine (char* s, boolean now = false) 
  30. {
  31.     g->ChangeStatusLine (s, now);
  32. }
  33.  
  34. extern "C" char* IGetText () 
  35. {
  36.     Namer *n = new Namer(g);
  37.     return n->Edit("\0");
  38. }
  39.  
  40. extern "C" void IPrintHelp ()
  41. {
  42.     Point* t = new Point(0, 0);
  43.     Helper* h = new Helper(g, t);
  44.     h->DoHelp();
  45.     delete h;
  46.     delete t;
  47. }
  48.  
  49. extern "C" void IShowNAttr(char** attr)
  50. {
  51.     av->ShowNAttr(attr);
  52. }
  53.  
  54. extern "C" void IShowEAttr(char** attr)
  55. {
  56.     av->ShowEAttr(attr);
  57. }
  58.  
  59. extern "C" void ISetAttrNames(char** nattr, char** eattr, int numna, int numea)
  60. {
  61.     av->SetAttrNames(nattr, eattr, numna, numea);
  62. }
  63.  
  64. extern "C" void IEraseAttrBox()
  65. {
  66.     av->EraseAttrBox();
  67. }
  68.  
  69. extern "C" void ISetDisplayed()
  70. {
  71.     if (av->SetDisplayed() != true)
  72.     {
  73.     g->ChangeStatusLine("Attributes window already opened!");
  74.     }
  75. }
  76.  
  77. extern "C" char IConfirm(char* s)
  78. {
  79.     Confirmer *c = new Confirmer(g, s);
  80.     return c->Confirm();
  81. }
  82.  
  83. extern "C" void IChangeToggles (char b[numopts]) 
  84. {
  85.     g->ChangeToggles(b);   
  86. }
  87.  
  88. extern "C" void IAddNode (Coord x0, Coord y0, Coord x1, Coord y1, NShape n, char* s,
  89.     boolean d, char* gp, char* ups, char* downs, BType brush,
  90.     CType color, boolean draw, int ord = -1)
  91. {
  92.     gr->AddNode (x0, y0, x1, y1, n, s, d, gp, ups, downs, brush, 
  93.          color, draw, ord);
  94. }
  95.  
  96. extern "C" void IAddEdge (Coord x0, Coord y0, Coord x1, Coord y1, boolean arr, char* gp,
  97.     char* s, BType brush, CType color, boolean draw, int ord = -1)
  98. {
  99.     gr->AddEdge (x0, y0, x1, y1, arr, gp, s, brush, color, draw, ord);
  100. }
  101.  
  102. extern "C" void IAddLine (Coord x0, Coord y0, Coord x1, Coord y1, BType brush, 
  103.     CType color, boolean draw)
  104. {
  105.     gr->AddLine (x0, y0, x1, y1, brush, color, draw);
  106. }
  107.  
  108. extern "C" void IEraseGraph ()
  109. {
  110.     gv->Erase ();
  111. }
  112.  
  113. extern "C" void ISetCursor (Curs c)
  114. {
  115.     g->SetCurs(c);
  116. }
  117.  
  118. extern "C" void IUnsetCursor ()
  119. {
  120.     g->UnsetCurs();
  121. }
  122.  
  123. extern "C" void ICenterGraph()
  124. {
  125.     gv->CenterGraph();
  126. }
  127.  
  128. extern "C" void IUpdateG()
  129. {
  130.     gv->UpdateG();
  131. }
  132.  
  133. extern "C" void IUpdateP()
  134. {
  135.     gv->UpdateP();
  136. }
  137.  
  138. extern "C" void IChangeZGrad(double zg)
  139. {
  140.     g->ChangeZGrad(zg);
  141. }
  142.  
  143. extern "C" void IChangePGrad(int x, int y)
  144. {
  145.     gv->ChangePGrad(x,y);
  146. }
  147.  
  148. extern "C" void IRedrawWorld()
  149. {
  150.     g->Draw();
  151. }
  152.  
  153. extern "C" void IGetBounds(int* x0, int* y0, int* width, int* height, 
  154.         int* curx, int* cury, int* curwidth, int* curheight)
  155. {
  156.     gv->GetBounds(x0, y0, width, height, curx, cury, curwidth, curheight);
  157. }
  158.  
  159. extern "C" void IInitFonts()
  160. {
  161.     g->InitFonts();
  162. }
  163.  
  164. extern "C" void ISetFont(int x, int y)
  165. {
  166.     g->SetFont(x, y);
  167. }
  168.  
  169. extern "C" int ITextFits()
  170. {
  171.     return g->TextFits();
  172. }
  173.  
  174. extern "C" int IOnNonDummyNode()
  175. {
  176.     return gv->CurOnNonDummyNode();
  177. }
  178.  
  179. extern "C" int IOnNode()
  180. {
  181.     return gv->CurOnNode();
  182. }
  183.  
  184. extern "C" int IOnEdge()
  185. {
  186.     return gv->CurOnEdge();
  187. }
  188.  
  189. extern "C" char *ICurNode()
  190. {
  191.     return gv->CurNode();
  192. }
  193.  
  194. extern "C" char *ICurEdge()
  195. {
  196.     return gv->CurEdge();
  197. }
  198.  
  199. extern "C" void IForceNL()
  200. {
  201.     g->ForceNL();
  202. }
  203.  
  204. extern "C" void INoForceNL()
  205. {
  206.     g->NoForceNL();
  207. }
  208.  
  209. extern "C" void IForceEL()
  210. {
  211.     g->ForceEL();
  212. }
  213.  
  214. extern "C" void INoForceEL()
  215. {
  216.     g->NoForceEL();
  217. }
  218.  
  219. extern "C" void IChangeMarkDummy()
  220. {
  221.     gv->ChangeMarkDummy();
  222. }
  223.  
  224. extern "C" void IChangeForceNL()
  225. {
  226.     gv->ChangeForceNL();
  227. }
  228.  
  229. extern "C" void IChangeForceEL()
  230. {
  231.     gv->ChangeForceEL();
  232. }
  233.  
  234. extern "C" void IChangePA()
  235. {
  236.     gv->ChangePA();
  237. }
  238.  
  239. extern "C" void IChangeLabels()
  240. {
  241.     gr->ChangeLabels();
  242. }
  243.  
  244. extern "C" void IFindSmallestFont(int* x, int* y)
  245. {
  246.     g->SmallestFont(x, y);
  247. }
  248.  
  249. extern "C" void IFocusGraph(int x, int y, double m)
  250. {
  251.     gv->FocusGraph(x, y, m);
  252. }
  253.  
  254. extern "C" void IChangeNodeText(char* s)
  255. {
  256.     gv->ChangeCurNodeLabel(s);
  257. }
  258.  
  259. extern "C" void IChangeEdgeLabel(char* p, char* n, int ord, char* s)
  260. {
  261.     gr->ChangeEdgeLabel(p, n, ord, s);
  262. }
  263.  
  264. extern "C" void IDelNode(char* n, int ord = -1)
  265. {
  266.     if (ord == -1)
  267.     {
  268.         gr->DelAllNodes(n);
  269.     }
  270.     else
  271.     {
  272.     gr->DelNode(n, ord);
  273.     }
  274. }
  275.  
  276. extern "C" void IDelEdge(char* p, char* n, int ord)
  277. {
  278.     gr->DelEdge(p, n, ord);
  279. }
  280.  
  281. extern "C" void IChangeNode(char* n, NShape s, BType b, CType c)
  282. {
  283.     gr->ChangeNode(n, s, b, c);
  284. }
  285.  
  286. extern "C" void IChangeEdge(char* p, char* n, int ord, BType b, CType c)
  287. {
  288.     gr->ChangeEdge(p, n, ord, b, c);
  289. }
  290.  
  291. extern "C" void IGetCurPos(int* x, int* y)
  292. {
  293.     gv->GetCurPos(x, y);
  294. }
  295.  
  296. extern "C" void ISetupMove(char* mnode, char* prevNode[], char* nextNode[], 
  297.     int numprev, int numnext)
  298. {
  299.     gv->SetupMove(mnode, prevNode, nextNode, numprev, numnext);
  300. }
  301.  
  302. extern "C" void IChangeBC()
  303. {
  304.     gv->ChangeBC();
  305. }
  306.  
  307. extern "C" void IResetCurrent()
  308. {
  309.     gv->ResetCurrent();
  310. }
  311.  
  312. extern "C" boolean IShapeSet()
  313. {
  314.     return g->ShapeSet();
  315. }
  316.  
  317. extern "C" boolean IColorSet()
  318. {
  319.     return g->ColorSet();
  320. }
  321.  
  322. extern "C" boolean IBrushSet()
  323. {
  324.     return g->BrushSet();
  325. }
  326.  
  327. extern "C" NShape ICurShape()
  328. {
  329.     return g->CurShape();
  330. }
  331.  
  332. extern "C" CType ICurColor()
  333. {
  334.     return g->CurColor();
  335. }
  336.  
  337. extern "C" BType ICurBrush()
  338. {
  339.     return g->CurBrush();
  340. }
  341.  
  342. extern "C" NShape INextShape(NShape s)
  343. {
  344.     return NextShape(s);
  345. }
  346.  
  347. extern "C" BType INextBrush(BType b)
  348. {
  349.     return NextBrush(b);
  350. }
  351.  
  352. extern "C" CType INextColor(CType c)
  353. {
  354.     return NextColor(c);
  355. }
  356.  
  357. extern "C" void ISetPS(char* fs)
  358. {
  359.     g->SetPS(fs);
  360. }
  361.  
  362. extern "C" int IWidthPS(char* s)
  363. {
  364.     return g->WidthPS(s);
  365. }
  366.